找传奇、传世资源到传世资源站!

C# 切换输入法 实例源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

C# 切换输入法 实例源码 C#语言基础-第1张using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace SwitchInput{ public partial class Frm_Main : Form { public Frm_Main() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { //获取系统中已经安装的文字输入法 InputLanguageCollection mInputs = InputLanguage.InstalledInputLanguages; foreach (InputLanguage mInput in mInputs) this.comboBox1.Items.Add(mInput.LayoutName); //获取当前输入法信息 InputLanguage CurrentInput = InputLanguage.CurrentInputLanguage; this.textBox1.Text = CurrentInput.LayoutName; //获取输入法的语言区域 this.textBox3.Text = CurrentInput.Culture.DisplayName; //获取默认的输入法信息 InputLanguage dInput = InputLanguage.DefaultInputLanguage; this.textBox2.Text = dInput.LayoutName; } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { //获取选择的输入法 InputLanguage mInput = InputLanguage.InstalledInputLanguages[comboBox1.SelectedIndex]; //设置当前输入法 InputLanguage.CurrentInputLanguage = mInput; //获取当前输入法信息 InputLanguage CurrentInput = InputLanguage.CurrentInputLanguage; this.textBox1.Text = CurrentInput.LayoutName; //获取输入法的语言区域 this.textBox3.Text = CurrentInput.Culture.DisplayName; //获取默认的输入法信息 InputLanguage dInput = InputLanguage.DefaultInputLanguage; this.textBox2.Text = dInput.LayoutName; } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复